
#define	BT_DEVICE_NUM	5	// Number of device list number

#define	BT_VOL_MAX		32
#define	BT_VOL_MIN		6
#define	BT_VOL_DEFAULT	20

#define	BT_DEVICE_NAME_LENGTH	32

#define	BT_LOCALNAME_SIZE		32
#define	BT_NUMBER_SIZE			8
#define	BT_CALLERID_LEN			20

typedef  struct
{
	unsigned char ucDeviceAdr[6];
	unsigned char ucName[BT_DEVICE_NAME_LENGTH];
	unsigned char ucService;
	unsigned char ucOrder;		// Connected Order
}BT_DEVICE;

#define	BT_VOL_MAX		32
#define	BT_VOL_MIN		6
#define	BT_VOL_DEFAULT	20

typedef  enum{
	BT_PRS_NONE,			// 0
	BT_PRS_INITIALIZE,		// 1
	BT_PRS_PAIRING,			// 2
	BT_PRS_DELETE,			// 3
	BT_PRS_CONNECT,			// 4
	BT_PRS_DISCONNECT,		// 5
	BT_PRS_OFF,				// 6
	BT_PRS_ON,				// 7
	BT_PRS_PABP_DOWNLOAD,	// 8
	BT_PRS_CALLHISTORY_DOWNLOAD,	// 9
	BT_PRS_LOOPBACK,
/////////// Under is Command Type ////////////
	BT_PRS_ANSWER_CALL,			// 10
	BT_PRS_HANDUP_CALL,			// 11
	BT_PRS_REJECT_CALL,			// 12
	BT_PRS_REDIAL,				// 13
	BT_PRS_DIALNUMBER,			// 14
	BT_PRS_CALL_TRANS,			// 15
	BT_PRS_AVRCP_CMD,			// 16
	BT_PRS_MIC_MUTE			// 17
}BT_PROC;

//unsigned char ucBT_Status;
#define	BT_AV_CONNECTED		0x0001
#define	BT_HF_CONNECTED		0x0002
#define	BT_PB_CONNECTED		0x0004
#define	BT_AVRCP_CONNECTED		0x0008
#define	BT_CONNECTED		BT_AV_CONNECTED | BT_HF_CONNECTED | BT_PB_CONNECTED | BT_AVRCP_CONNECTED
#define	BT_HF_CALLING		0x0010
#define	BT_HF_INCOMMING		0x0020
#define	BT_HF_CALL			0x0030
#define	BT_PAIRING			0x0040
#define	BT_INIT_OK			0x0100
#define	BT_FUNC_ON			0x0200

//unsigned char ucBT_ProcessSeq;
#define	BT_PAIRING_PRECHECK			0
#define	BT_PAIRING_SET				1
#define	BT_PAIRING_WAIT_DISCON		2
#define	BT_PAIRING_WAIT				3
#define	BT_PAIRING_SUCCESS			4
#define	BT_PAIRING_FAIL				5
#define	BT_PAIRING_READ_DEVICE_INFO	6
#define	BT_PAIRING_REQ_CONNECT		7

#define	BT_DELETE_PRE				0
#define	BT_DELETE_WAIT_DISCON		1
#define	BT_DELETE_SET_DELETE			2
#define	BT_DELETE_WAIT_DELETE		3
#define	BT_DELETE_REQ_LIST			4

#define	BT_CON_SEQ_CHK				0
#define	BT_CON_SEQ_WAIT_DC			1
#define	BT_CON_SEQ_DISP_NAME		2
#define	BT_CON_SEQ_REQ_C			3
#define	BT_CON_SEQ_WAIT_C			4
#define BT_CON_SEQ_DEVICE_NAME		5
#define	BT_CON_SEQ_FAIL				6

#define	BT_COM_SEQ_SETCMD			0
#define	BT_COM_SEQ_WAIT_CFM			1
#define	BT_PRS_AVRCP_CMD_REL_MUTE	2

#define	BT_INIT_SEQ_RESET0			1
#define	BT_INIT_SEQ_RESET1			2
#define	BT_INIT_SEQ_WAIT			3
#define	BT_INIT_SEQ_CMD1			4
#define	BT_INIT_SEQ_CMD2			5
#define	BT_INIT_SEQ_CMD3			6
#define	BT_INIT_SEQ_BOOT_WAIT		7

#define	BT_DIS_SEQ_PRE				0
#define	BT_DIS_SEQ_CMD				1
#define	BT_DIS_SEQ_WAIT				2

#define	BT_OFF_SEQ_DISCON			0
#define	BT_OFF_SEQ_DISCON_WAIT		1
#define	BT_OFF_SEQ_OFF				2
#define	BT_OFF_SEQ_WAIT				3

#define	BT_ON_SEQ_ON				0
#define	BT_ON_SEQ_WAIT				1

#define	BT_PBAP_CHECK_CON			0
#define	BT_PBAP_WAIT_CON			1
#define	BT_PBAP_CHECK_FLASH			2
#define	BT_PBAP_REQUEST_DATA		3
#define	BT_PBAP_DOWNLOADING			4
#define	BT_PBAP_WAIT_START			5
#define	BT_PBAP_WRITE_DEVICE_ADDR	6
#define	BT_PBAP_WRITE_DEVICE_ADDR_WAIT	7

typedef enum{
	BT_AVRCP_PLAY_PAUSE,
	BT_AVRCP_STOP,
	BT_AVRCP_NEXT,
	BT_AVRCP_PREVIOUS,
	BT_AVRCP_FF,
	BT_AVRCP_REW	
}BT_AVRCP;

unsigned char BT_GetInitStatus(void);
void BT_SetInitStart(void);

#define	BT_DB_ADR_NORMAL	0
#define	BT_DB_ADR_01		1
#define	BT_DB_ADR_02		2

void BT_SetDBAddress(unsigned char ucMode);
unsigned char BT_GetDBAddress(void);
unsigned char BT_ConnectStatus(void);
unsigned char BT_HF_ConnectStatus(void);
unsigned char BT_HF_CallStatus(void);
unsigned char BT_A2DP_ConnectStatus(void);

